home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
ACKSRC.ZIP
/
NOTES.TXT
< prev
next >
Wrap
Text File
|
1993-06-20
|
31KB
|
816 lines
ACK-3D
( Animation Construction Kit 3D )
Disclaimer
The author, Lary Myers, and any other persons referred to
in this documentation or in the computer programs ACK3D and MAPEDIT
accept no responsibility for any loss of time, money or productivity,
or damage to any person(s) or computer hardware or software, as a
result of using the programs ACK3D and MAPEDIT, even if the above
mentioned had knowledge or had been notified of the possibilities
of such events.
Distribution and Usage
Considerable thought has gone into just how the source code for ACK3D
would be released. Some possibilities included providing only the construction
kit and selling the source to interested parties, or providing the source to
be used as freeware for private use but requiring license for commercial ventures,
and so forth.
What I've decided is to release all the source, header files, notes, etc
into the public domain as "PUBLICWARE". You may freely use the engine source
and associated files for the programs ACK3D and MAPEDIT anyway you see fit.
One of the goals when I started this project was to place the means into other
peoples hands, more talented than I, so they could then create worlds of
adventure and entertainment for the rest of us to share in.
Here is the one reservation that I must insist on.
The author, Lary Myers, hereby grants the right to use, modify, and sell
the source code provided in the ACK3D collection of files, with the stipulation
that Lary Myers accepts no responsibilty for changes desired in the code, bug
fixes, or future updates.
Now, with all that aside, PLEASE let me know of any comments and/or
suggestions you may have regarding possible uses for the engine and any
enhancements you wish to share with me and others. The entire project is
still far from over and together maybe we can create a powerful engine for
use in a wide variety of applications.
------------------------------------------------------------------------------
Programming notes:
Author: Lary Myers
Development system: 486DX 33Mhz
8 Meg RAM
210 Meg HD
Boca VGA
Microsoft mouse
Borland C++ Version 3.1
Microsoft Macro Assembler Version 5.00A
Languages used: C and Assembler
Model used: Compact
------------------------------------------------------------------------------
Compiling the engine:
1. Place all of the files from the .ZIP file into one directory. Since I
use Borland I opted for the following directory structure;
\BORLANDC\ACK3D\SRC <- Contains all the source for the engine
\BORLANDC\ACK3D\KIT <- Contains executables, images, for the kit
2. Several years ago I wrote a program called MK.EXE which was used to
MAKE programs based on dependencies, etc. Even though the compilers
nowadays have much better makes, I still use this old one of mine, so
the .MAK files provided with the engine are based on using it with
MK.EXE. You can either use them as is (if you have BorlandC) or use
them to see what's needed to create a standard MAKE file. If you use
MK then type in the following to begin the process;
MK A <- This will build the ACK3D engine
MK M <- This will build the Map Editor
------------------------------------------------------------------------------
Goals:
1. Create a 3D graphic engine which visually mimics the Wolfenstein
3D game as a starting point, then add new features and interface.
2. Use the engine to create a generic construction kit.
3. Provide the source and construction kit to the general public.
Techniques:
The graphic engine is based on a technique called Ray Casting, a term
that has been used to describe the process where a 2D representation of a
maze is rendered in 3D. The details of Ray Casting are provided below;
1. Using a two dimensional map similiar to graph paper, a maze is built
consisting of borders (walls) in both the X and Y planes. These walls
describe the physical boundaries of the map. Figure 1 shows an example
of a simple map.
X
╔════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╗
Y ║....║....║....║....║....║....║....║....║....║....║....║....║
║....║....║....║....║....║....║....║....║....║....║....║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║....║
║....║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║....║....║....║....║....║ ║ ║ ║....║
║....║ ║ ║....║....║....║....║....║ ║ ║ ║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║....║ ║ ║ ║....║ ║ ║ ║....║
║....║ ║ ║....║ ║ ║ ║....║ ║ ║ ║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║ ║ ║ ║ ║....║ ║ ║ ║....║
║....║ ║ ║ ║ ║ ║ ║....║ ║ ║ ║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║....║ ║ ║ ║....║....║....║....║....║
║....║ ║ ║....║ ║ ║ ║....║....║....║....║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║ ║ ║....║ ║ ║ ║ ║ ║ ║ ║....║
║....║ ║ ║....║ ║ ║ ║ ║ ║ ║ ║....║
╠════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╬════╣
║....║....║....║....║....║....║....║....║....║....║....║....║
║....║....║....║....║....║....║....║....║....║....║....║....║
╚════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╝
╔════╗
║....║ Indicates a square that has walls
║....║
╚════╝
╔════╗
║ ║ Indicates a blank square
║ ║
╚════╝
Figure 1
2. The map is made up of cubes, each having a fixed size. For our
purposes we'll use 64x64 units for each square. This allows an
object (or player) to move 64 units in either the X or Y direction
before moving into another square. The total map is made up of
a number of squares to form rows and a number of rows to form a
two dimensional array (again, just like graph paper has some number
or sqaures by some number of rows of squares).
3. A player is then defined as a location on the map having three
properties, an X and Y coordinate as well as an Angle that the
player is currently facing. Figure 2 shows this relationship.
╔════╦════╦════╦════╦
║....║....║....║....║
║....║....║....║....║ P - The current location of the player
╠════╬════╬════╬════╬
║....║ ║ ║ ║ -> The current angle the player is facing
║....║ P->║ ║ ║
╠════╬════╬════╬════╬
║....║ ║ ║....║
║....║ ║ ║....║
╠════╬════╬════╬════╬
║....║ ║ ║....║
║....║ ║ ║....║
╠════╬════╬════╬════╬
Figure 2
4. Once we know where the Player is and the current angle the player is
facing, we can begin to determine what will be visible at that moment
in time. To begin with, we need to decide on the field of vision that
will be used. ACK3D uses a 60 degree field of vision to show the
walls in a realistic setting. This means that the player will see all
items 30 degrees to the left of the current viewing angle to 30 degrees
to the right of the current angle. Figure 3 illustrates this.
/
/ -30 degrees from viewing angle (VA - 30)
/
/
P -------------> Current viewing angle (VA)
\
\
\ +30 degrees from viewing angle (VA + 30)
\
Figure 3
5. As you can see, if we superimpose Figure 3 onto figure 2 we begin to
get a field of vision which encompasses those walls in front of the
player (at the current viewing angle). This gives us Figure 4.
0 1 2 3
╔════╦════╦════╦════╦
0 ║....║....║.../║....║
║...